package com.scy.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class MyServletContextListener implements ServletContextListener {

    //框架自动调用
    static {
        System.out.println("MyServletContextListener类的静态代码块执行了");
    }

    //框架自动调用
    public MyServletContextListener() {
        System.out.println("MyServletContextListener类的无参构造方法执行了");
    }

    //框架自动调用
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("MyServletContextListener类中的contextInitialized方法执行了");
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("MyServletContextListener类中的contextDestroyed方法执行了");
    }
}
